<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        {{changeMsg}}
        <p>
            {{rnum}}
        </p>
        <p>
            {{price*cont}}
        </p>
    </div>
</body>
<script src="./vue.min.js"></script>
<script>
    let vm = new Vue({
        el:"#app",
        data:{
            msg:"狗蛋",
            num:"12345",
            price:12,
            cont:5
        },
        computed:{
            changeMsg(){
                let msg = this.msg;
                if(msg=="狗蛋"){
                    msg = "张三"
                }
                return msg
            },
            rnum(){
                let num = this.num;
                num = num.split("");
                num = num.reverse();
                num = num.join("");
                return num;
            }
        }
    })
</script>
</html>